home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / cat3 / GetUid.3 < prev    next >
Text File  |  1994-09-20  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4. Tk_GetUid(3)          Tk Library Procedures
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      Tk_GetUid, Tk_Uid - convert from string to unique identifier
  12.  
  13. SYNOPSIS
  14.      #include <tk.h>
  15.  
  16.      #typedef char *Tk_Uid
  17.  
  18.      Tk_Uid
  19.      Tk_GetUid(_s_t_r_i_n_g)
  20.  
  21. ARGUMENTS
  22.      char*_s_t_r_i_n_g(in)
  23.      String for  which  the  corresponding  unique  identifer  is
  24.      desired.
  25. _________________________________________________________________
  26.  
  27.  
  28. DESCRIPTION
  29.      Tk_GetUid returns the  unique  identifier  corresponding  to
  30.      _s_t_r_i_n_g.   Unique  identifiers  are similar to atoms in Lisp,
  31.      and are used in Tk to speed up comparisons and searches.   A
  32.      unique  identifier (type Tk_Uid) is a string pointer and may
  33.      be used anywhere that a variable of type ``char *'' could be
  34.      used.  However, there is guaranteed to be exactly one unique
  35.      identifier for any given  string  value.   If  Tk_GetUid  is
  36.      called twice, once with string _a and once with string _b, and
  37.      if _a and _b have the same string value (strcmp(a, b)  ==  0),
  38.      then Tk_GetUid will return exactly the same Tk_Uid value for
  39.      each call (Tk_GetUid(a) == Tk_GetUid(b)).  This  means  that
  40.      variables  of  type Tk_Uid may be compared directly (x == y)
  41.      without having to call  strcmp.   In  addition,  the  return
  42.      value  from Tk_GetUid will have the same string value as its
  43.      argument (strcmp(Tk_GetUid(a), a) == 0).
  44.  
  45.  
  46. KEYWORDS
  47.      atom, unique identifier
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Tk                                                              1
  64.  
  65.  
  66.  
  67.